package summer_vacation.shuqiqi.java;

import java.util.Scanner;

/**
 * Created by shuqi on 2015/8/12.
 */
public class Assignment_12 {
    public static void main(String[] args) {
        int a,b,i;
        System.out.println("请输入一个整数：");
        Scanner input=new Scanner(System.in);
        b= input.nextInt();
        i =  b/2;
        for (a=2; a<=i; a++) {
            if (b %a== 0) {
                System.out.println("此数不为素数");
                break;
            }
        }
        if (a>i) {
            System.out.println("此数为素数");
        }
    }
}

